<?php
namespace app\admin\controller;
use think\facade\View;
use app\admin\model\Nav;
class Index
{
    public function index()
    {
        $nav = Nav::select();
        $navs = [];
        foreach($nav as $r){
                if(!isset($navs[$r['parent_id']])) $navs[$r['parent_id']] = [];
                $navs[$r['parent_id']][] = $r;

        }
        View::assign('navs',$navs);
    	return View::fetch();
    }
}
